﻿namespace NetFx.SMIL.References
{
  using System;
  using System.Text;
  using System.Collections;
  using System.Collections.Generic;

  using System.Reflection;
  using System.Reflection.Emit;
  using System.Runtime.InteropServices;

  using System.Diagnostics;
  using System.Diagnostics.CodeAnalysis;
  using System.Diagnostics.SymbolStore;
  using System.Security;
  using System.Security.Permissions;

  using NetFx.AGIL;

  /// <summary>
  /// 对转换的引用（常数封装）。
  /// </summary>
  public class ConvertionRef:Reference
  {
    #region Statics
    public static ConvertionRef of(Convertions? conv)
    {
      return new ConvertionRef(conv);
    }
    #endregion
    #region Properties
    public virtual Convertions? Convertion
    {
      get
      {
        return this.Referenced as Convertions?;
      }
    }
    public virtual Convertions? ReflectInfo
    {
      get
      {
        return this.Convertion;
      }
    }
    public virtual bool HasReflectInfo
    {
      get
      {
        return this.ReflectInfo != null;
      }
    }

    #endregion
    #region Constructors
    public ConvertionRef(Convertions? conv)
      : base(conv) 
    {
    }
    #endregion
    #region Methods
    public override string ToString()
    {
      return this.HasReflectInfo ?
        string.Format("{0}", this.Convertion.ToString()) :
        string.Format("{0}", Convertions.Unknown.ToString());
    }
    #endregion
  }
}
